using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace CodePlex.EnterpriseFramework
{
    public class ConfigurationManager
    {
        public static string SchemaFolderPath
        {
            get 
            {
                return ConfigurationSettings.AppSettings["schemaPathFolder"];
            }
        }

        public static string MapFolderPath
        {
            get
            {
                return ConfigurationSettings.AppSettings["MapPathFolder"];
            }
        }

        public static int SharepointUpdateTimeout
        {
            get
            {
                int timeout = 50000; //50 seconds
                try
                {
                    timeout = int.Parse(ConfigurationSettings.AppSettings["SharepointUpdateTimeout"]);
                }
                catch(Exception){}
                return timeout;
            }
        }        

        public static bool ISArchive
        {
            get 
            { 
                bool result = true; //default value
                try
                {
                    result = bool.Parse(ConfigurationSettings.AppSettings["Archive"]);
                }
                catch(Exception){}
                return result;                
            }
        }

        public static string ArchiveFolder
        {
            get { return ConfigurationSettings.AppSettings["ArchiveFolder"]; }
        }

        public static bool IsDeleteMetadataFileAfterProcessing
        {
            get
            {
                bool result = true; //default value
                try
                {
                    result = bool.Parse(ConfigurationSettings.AppSettings["DeleteMetadataFileAfterProcessing"]);
                }
                catch (Exception) { }
                return result;
            }
        }

        public static string WatchingFolder
        {
            get { return ConfigurationSettings.AppSettings["WatchingFolder"]; }
        }
    }
}
